﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SSharp.Core.DataTypes;

namespace SSharp.Core.Evaluator {
	public static partial class Eval {
		/// <summary>
		/// Evaluates variables
		/// </summary>
		private class VariableEvaluator : Evaluator {
			public bool CanEvaluate(object expression) {
				return expression is Symbol;
			}

			public EvaluationResult Evaluate(object expression, IEnvironment env) {
				Symbol symbol = (Symbol)expression;
				return new EvaluationResult(env[symbol]);
			}
		}
	}
}
